//引入mongoose
const mongoose = require('mongoose')
//定义Schema
const UserSchema = mongoose.Schema({
  username: {
    type: String,
    required: true
  },
  email: {
    type: String,
    required: true
  },
  password: {
    type: String,
    required: true
  },
  phone: {
    type: Number
  },
  avatar: {
    type: String
  },
  job: {
    type: String
  },
  role_id: {
    type: String,
    default: ''
  },
  create_time: {
    type: Date,
    default: Date.now
  }
})
//暴露
module.exports = mongoose.model('User', UserSchema)